package com.gwtcx.sample.serendipity.client.entrypoint;

import org.gwtmultipage.client.UrlPatternEntryPoint;

import com.google.gwt.core.client.GWT;
import com.gwtcx.client.NameTokens;
import com.smartgwt.client.util.SC;

@UrlPatternEntryPoint(value = "Serendipity.html(\\\\?locale=(en|de))?((&|\\\\?)gwt.codesvr=127.0.0.1:9997)?")
public class Serendipity extends MultiPageEntryPoint {
	@Override
	protected void revealCurrentPlace(String page) {
		if(page == null) {
			SC.say("page가 널임");
			return;
		}
		
		if(page.equals(NameTokens.mainPage)) {
			GWT.log("Serendipity entrypoint page : " + page);

			getSerendipityGinjector().getPlaceManager().revealCurrentPlace();
		} else {
			SC.say("Page name token : " + page);
		}
	}
}
